import { getHomePageInfo } from '../../../services/api';

export default {
  namespace: 'financial',

  state: {},

  effects: {
    *fetch({ payload: currentPage }, { call, put }) {
      const response = yield call(getHomePageInfo, currentPage);
      const arr = [];
      arr.push(response);
      yield put({
        type: 'save',
        payload: arr,
      });
    },
  },

  reducers: {
    save(state, action) {
      return {
        ...state,
        data: action.payload,
      };
    },
  },
};
